package ripine;

import java.util.Scanner;

public class J10Return {

	/*
	 * return 문을 사용하는 메서드
	 */

	public static void main(String[] args) {
		// 변수선언
		int x, y; // 사칙연산할 입력값
		int sum, minus, multple, divide;

		Scanner scan = new Scanner(System.in);
		System.out.println("x,y 값을 입력하세요");
		x = scan.nextInt();
		y = scan.nextInt();

		/* 먼저, 메서드가 호출되고
		 * 메서드가 return한 결과값을 변수에 저장
		 */
		sum = getSum(x, y);
		minus = getMinus(x, y);
		multple = getMultple(x, y);
		divide = getDivide(x, y);

		System.out.println(x);
		System.out.println(y);
		System.out.println("더하기"+sum);
		System.out.println("빼기"+minus);
		System.out.println("곱하기"+multple);
		System.out.println("나누기"+divide);
	}// main() end

	private static int getDivide(int x, int y) {
		return x / y;
	}

	private static int getMultple(int x, int y) {
		return x * y;
	}

	private static int getMinus(int x, int y) {
		return x - y;
	}

	private static int getSum(int x, int y) {
		return x + y;
	}

}// J10Return class end
